import request from '@/utils/request'

const root = `/cameraServer`

export const URL = root

/**
 * 获取设备
 */
export function getDevice() {
  return request({
    url: `${root}/device=getequipmenttype`,
  })

}

/**
 * 关闭摄像头
 */
export function closeCamera(data) {
  return request({
    url: `${root}/video=close`,
    method: 'post',
    data: data
  })
}

/**
 * 获取当前图片base64（拍照）
 */
export function getPhotoBase64(data) {
  return request({
    url: `${root}/video=grabimage`,
    method: 'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' },
    data:data
  })
}
